home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DIRS.SWG / 0018_Check for Directory.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  731b  |  23 lines

  1.  
  2. {*****************************************************************************
  3.  * Function ...... IsDir()
  4.  * Purpose ....... To check for the existance of a directory
  5.  * Parameters .... Dir        Dir to check for
  6.  * Returns ....... TRUE if Dir exists
  7.  * Notes ......... None
  8.  * Author ........ Martin Richardson
  9.  * Date .......... May 13, 1992
  10.  *****************************************************************************}
  11. FUNCTION IsDir( Dir: STRING ) : BOOLEAN;
  12. VAR
  13.    fHandle: FILE;
  14.    wAttr: WORD;
  15. BEGIN
  16.      WHILE Dir[LENGTH(Dir)] = '\' DO DEC( Dir[0] );
  17.      Dir := Dir + '\.';
  18.      ASSIGN( fHandle, Dir );
  19.      GETFATTR( fHandle, wAttr );
  20.      IsDir := ( (wAttr AND DIRECTORY) = DIRECTORY );
  21. END;
  22.  
  23.